package com.itheima.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> {
    private boolean successs;
    private Integer code;
    private String message;
    private T data;

    public static <T> Result<T> success(T data){
        return new Result<>(true,200,"successs",data);
    }

    public static <T> Result<T> fail(Integer code,String message){
        return new Result<>(false,code,message,null);
    }

}
